home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / S9303.ZIP;1 / SPENCE.ZIP / UTILS.PRG < prev   
Encoding:
Text File  |  1993-01-06  |  1.1 KB  |  49 lines

  1. // Utils.prg
  2. //
  3. // Utility routines for TBrowse
  4.  
  5. #include "InKey.ch"
  6.  
  7. // Default column separator
  8. #define DEF_CSEP  " " + chr(179) + " "
  9.  
  10. // Default heading separator
  11. #define DEF_HSEP chr(205) + chr(209) + chr(205)
  12.  
  13. // Default footing separator
  14. #define DEF_FSEP chr(205) + chr(207) + chr(205)
  15.  
  16. FUNCTION StdMeth(oTbr, nKey)
  17.  
  18. LOCAL lKeyHandled := .T.
  19.  
  20.   DO CASE
  21.     CASE nKey == K_UP;        oTbr:up()
  22.     CASE nKey == K_DOWN;      oTbr:down()
  23.     CASE nKey == K_PGUP;      oTbr:pageUp()
  24.     CASE nKey == K_PGDN;      oTbr:pageDown()
  25.     CASE nKey == K_RIGHT;     oTbr:right()
  26.     CASE nKey == K_LEFT;      oTbr:left()
  27.     CASE nKey == K_HOME;      oTbr:home()
  28.     CASE nKey == K_CTRL_PGUP; oTbr:goTop()
  29.     CASE nKey == K_CTRL_PGDN; oTbr:goBottom()
  30.     CASE nKey == K_END;       oTbr:end()
  31.     OTHERWISE;            lKeyHandled := .F.
  32.   ENDCASE
  33.  
  34. RETURN lKeyHandled
  35.  
  36.  
  37. FUNCTION TbInit(oTbr, nTop, nLeft, nBottom, nRight)
  38.  
  39.   oTbr:colSep  := DEF_CSEP
  40.   oTbr:headSep := DEF_HSEP
  41.   oTbr:footSep := DEF_FSEP
  42.  
  43.   oTbr:nTop    := nTop
  44.   oTbr:nLeft   := nLeft
  45.   oTbr:nBottom := nBottom
  46.   oTbr:nRight  := nRight
  47.  
  48. RETURN NIL
  49.